<template>
    <el-main>
        <el-main class="ep-body">
            <epl-top-bar :datas="{formData:form}" :panel="panel" showPerson psTagType="PERSON_PENSION_QUERY" personType="PERSON_ALL_EXACT">
            </epl-top-bar>
            <epl-userMessage dataType="person" idCount = "3" :panel="panel">
                <template slot-scope="scope">
                    <epl-userMessageItem title="当前待遇" :sum="form.sum.value">
                        <epl-column label="扣发总月数" :value="form.calmonth.value"></epl-column>
                        <epl-column label="扣发总金额" :value="'￥'+form.calmoney.value"></epl-column>
                        <epl-column label="实发金额" :value="'￥'+form.totalmoney.value"></epl-column>
                    </epl-userMessageItem>
                </template>
            </epl-userMessage>
            <el-card class="ep-card">
                <el-form :model="form" ref="form" :rules="rules">
                    <el-row :gutter="10" v-show="false">
                        <ep-input colspan="8" label="sum" name="sum" :property="form.sum"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="calmonth" name="calmonth" :property="form.calmonth"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="calmoney" name="calmoney" :property="form.calmoney"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="totalmoney" name="totalmoney" :property="form.totalmoney"
                                  p="D" :datas="{pageData:form}"></ep-input>

                        <ep-title>待遇发放方式</ep-title>
                        <ep-select colspan="8" label="领取人证件类型" name="aac059" :property="form.aac059"
                                   p="D" codetype="AAC059" 
                                   :datas="{pageData:form}"></ep-select>
                        <ep-input colspan="8" label="领取人证件号码" name="aae136" :property="form.aae136"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="领取人姓名" name="aae133" :property="form.aae133"
                                  p="D" :datas="{pageData:form}"></ep-input>
                    </el-row>
                    <el-row :gutter="10" v-show="false">
                        <ep-select colspan="8" label="待遇发放方式" name="aae145" :property="form.aae145"
                                   p="D" :datas="{pageData:form}" codetype="AAE145"></ep-select>
                        <ep-input colspan="8" label="地址" name="aae006" :property="form.aae006"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="邮政编码" name="aae007" :property="form.aae007"
                                  p="D" :datas="{pageData:form}"></ep-input>
                    </el-row>
                    <ep-title>请输入待遇终止信息</ep-title>
                    <el-row :gutter="10">
                        <ep-input colspan="8" label="移交社区综合性补贴待追回金额" name="yjsq" placeholder="请输入移交社区综合性补贴待追回金额" :property="form.yjsq"
                                  p="R" rules="this.$localRules.isMoney"
                                  :datas="{pageData:form}"></ep-input>
                        <ep-select colspan="8" label="终止原因" name="aae160" placeholder="请选择终止原因" :property="form.aae160"
                                   p="R" :datas="{pageData:form}" SelectFilterData="aaa102 in ('1201','1202','1203','1206','1207','1299')" codetype="AAE160" ></ep-select>
                        <ep-date colspan="8" label="终止年月" name="aae041" placeholder="请选择终止年月" :property="form.aae041"
                                 p="R" :datas="{pageData:form}" format="yyyyMM"></ep-date>
                    </el-row>
                    <ep-title>请输入一次性待遇发放信息</ep-title>
                    <el-row :gutter="10">
                        <ep-select colspan="8" placeholder="请选择领取人关系" label="领取人关系" codetype="AAA223" name="aaa223"  :property="form.aaa223" p="R"
                                   :datas="{formData:form}" rules="this.$rules.test_noBlank"></ep-select>
                        <ep-input colspan="8" label="领取人姓名" placeholder="请输入领取人姓名" name="aae133" :property="form.aae133"
                                  p="R" :datas="{pageData:form}"></ep-input>
                        <ep-select colspan="8" placeholder="请选择领取人证件类型" label="领取人证件类型" codetype="AAC059" name="aac059"  :property="form.aac059" p="R"
                                   :datas="{formData:form}" rules="this.$rules.test_noBlank"></ep-select>

                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="8" label="领取人证件号码" placeholder="请输入领取人证件号码" name="aae136" :property="form.aae136"
                                  p="R" :datas="{pageData:form}"></ep-input>
                        <ep-select colspan="8" placeholder="请选择发放方式" label="发放方式" name="aae145" :property="form.aae145" p="R" codetype="AAE145" rules="this.$rules.test_noBlank"
                                   :datas="{formData:form}"></ep-select>
                        <ep-select colspan="8" label="发放银行" name="aaz065" :property="form.aaz065" placeholder="请选择发放银行"
                                   p="R" :datas="{formData: form}" codetype="AAZ065" rules="this.$rules.test_noBlank"></ep-select>
                    </el-row>

                    <el-row :gutter="10">
                        <ep-input colspan="8" label="银行账号" name="aae010" :property="form.aae010" placeholder="请输入银行账号"
                                  p="R" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="银行开户名" name="aae009" :property="form.aae009" placeholder="请输入银行开户名"
                                  p="R" :datas="{pageData:form}"></ep-input>
                        <epl-search-bank colspan="8" label="开户行行号" name="aaf002" :property="form.aaf002" placeholder="请选择开户行行号"
                                         p="R" :datas="{formData: form}" codetype="AAZ065" bankName="aaz065" show rules="this.$rules.test_noBlank"></epl-search-bank>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="16" label="开户行名称"  name="bac049" :property="form.bac049" p="D" rules="this.$rules.test_noBlank"
                                  :datas="{formData:form}"></ep-input>
                        <ep-input colspan="8" label="邮政编码" name="aae007" :property="form.aae007"  placeholder="请输入邮政编码"
                                  p="E" :datas="{pageData:form}" rules="this.$rules.postcode"></ep-input>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="联系地址" name="bae011" :property="form.bae011"
                                   placeholder="请选择省" codetype="BAE007" p="E"  :datas="{formData:form}" isChange isCodeType></ep-select>
                        <ep-select colspan="4" label="" label-width="0" name="bae012" :property="form.bae012"
                                   placeholder="请选择市" codetype="BAE008" p="E" :datas="{formData: form}" isChange isCodeType
                                   SelectFilterData=" aaa102 like substr(':bae011',0,2)||'%' and aaa102 like '%00' "></ep-select>
                        <ep-select colspan="4" label="" label-width="0" name="bae013" :property="form.bae013"
                                   placeholder="请选择区县" codetype="BAE009" p="E" :datas="{formData: form}"
                                   SelectFilterData=" aaa102 like substr(':bae012',0,4)||'%'" ></ep-select>
                        <ep-input colspan="8" label="" label-width="0" name="aae006" :property="form.aae006"
                                  placeholder="请输入详细地址" p="E" :datas="{formData:form}"></ep-input>
                    </el-row>
                    <ep-title>待遇汇总信息</ep-title>
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="待遇补扣发类型" v-show="false" name="aaa077" :property="form.aaa077"
                                   p="D" codetype="AAA077" 
                                   :datas="{pageData:form}"></ep-select>
                        <ep-input colspan="8" label="补扣发开始年月" name="bac061" format="yyyyMM" :property="form.bac061"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="补扣发结束年月" name="aae042" format="yyyyMM" :property="form.aae042"
                                  p="D" :datas="{pageData:form}"></ep-input>
                        <ep-input colspan="8" label="补扣发总月数" name="calmonth" :property="form.calmonth"
                                  p="D" :datas="{pageData:form}"></ep-input>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="8" label="补扣发总金额" name="calmoney" :property="form.calmoney"
                                  p="D" :datas="{pageData:form}"></ep-input>
                    </el-row>
                    <el-row type="flex" justify="center">
                        <ep-button id="cal" api="doQuery" type="primary" top="20" bottom="20"
                                   :datas="{formData: form,tableData1:tableData1,tableData2:tableData2,tableData3:tableData3,panel:panel}"
                                   name="计算"></ep-button>
                        <ep-saveButton id="doSave" type="primary" top="20" bottom="20" ref="save" @formValidate="formValidate"
                                       :validate="['form']"
                                       :datas="{formData: form,panel:panel,tableData1:tableData1,tableData2:tableData2,tableData3:tableData3}"></ep-saveButton>
                    </el-row>
                </el-form>
                <el-tabs v-model="activeName2" type="card">
                    <el-tab-pane label="一次性待遇明细"  name="1">
                        <ep-table :data="tableData1" edited="true" :pager="20" :titleFilter="table1">
                            <ep-table-column sortable editor="text" name="aac001" header="人员ID"></ep-table-column>
                            <ep-table-column  sortable editor="text" name="aaa036" header="待遇项目"></ep-table-column>
                            <ep-table-column sortable editor="text" name="aaa037" header="待遇项目名称"></ep-table-column>
                            <ep-table-column sortable  editor="text" name="aae003" header="对应费款所属期"></ep-table-column>
                            <ep-table-column sortable editor="text" name="calmoney" header="核发金额"></ep-table-column>
                            <ep-table-column sortable editor="text" name="aae140" header="险种类型"></ep-table-column>
                            <!--隐藏的列-->
                            <ep-table-column editor="text" width="30" name="aae041" header="停发开始年月" hidden
                            ></ep-table-column>
                            <ep-table-column editor="text" width="30" name="aab301" header="行政区划代码"  hidden
                            ></ep-table-column>
                            <ep-table-column editor="text" width="30" name="aaa027" header="统筹区编码" hidden
                            ></ep-table-column>
                        </ep-table>
                    </el-tab-pane>
                    <el-tab-pane label="待遇扣发明细" name="2">
                        <ep-table :data="tableData2" :pager="20" :titleFilter="table2">
                            <ep-table-column editor="text" sortable name="aac001" header="人员ID"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aaa036" header="待遇项目"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aaa037" header="待遇项目名称"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aaa078" header="补扣标志"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aae003" header="对应所属期"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aae002" header="费款所属期"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aae019" header="金额"></ep-table-column>
                            <ep-table-column editor="text" sortable name="calmoney" header="核发金额"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aae140" header="险种类型"></ep-table-column>
                        </ep-table>
                    </el-tab-pane>
                    <el-tab-pane label="定期待遇明细" name="3">
                        <ep-table :data="tableData3" :pager="20" :titleFilter="table3">
                            <ep-table-column editor="text" sortable name="aaa036" header="待遇项目"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aaa037" header="待遇项目名称"></ep-table-column>
                            <ep-table-column editor="text"  sortable name="aae041" header="扣发开始年月"></ep-table-column>
                            <ep-table-column editor="text" sortable name="aae019" header="金额"></ep-table-column>
                            <ep-table-column editor="text" sortable header="扣发月份" name="bac062"></ep-table-column>
                            <ep-table-column editor="text" sortable header="扣发金额" name="bac063"></ep-table-column>
                        </ep-table>
                    </el-tab-pane>
                </el-tabs>
            </el-card>
        </el-main>
    </el-main>
</template>

<script src="../js/BenefitStatusEndJS.js"></script>
